<?php

namespace App\Mail;

use App\Models\AdminEmail;
use App\Models\Celebrity;
use App\Models\Configuration;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class CelebrityEmail extends Mailable
{
    use Queueable, SerializesModels;
    public $mail_temp;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($mail_temp)
    {
        $this->mail_temp = $mail_temp;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {

        //info($this->mail_temp['email_content']);
        //info($this->mail_temp['email_name']);
        return $this
            ->subject($this->mail_temp['email_subject'])
            //发件人
            ->from($this->mail_temp['email_from_address'],$this->mail_temp['email_name'])
            ->view('emails.celebrity')
            ->with([
                'email_content' => $this->mail_temp['email_content'],
            ]);


    }
}
